﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using OPMS_V1.DOL;
using System.Data;

namespace OPMS_V1.BOL
{
    public class ChooseState
    {
        //Initializing the DOL Class associated with it.
        ListStates tempState = new ListStates();

        /// <summary>
        /// This function is used for Getting the List of districts within a state
        /// </summary>
        /// <param name="statename"></param>
        /// <returns></returns>
        public List<String> getDistrict(string statename)
        {
            List<String> districtData = new List<string>();
            //Storing all the names of districts in the List Collection
            districtData = tempState.retrieveDistrictStates(statename);

            return districtData;
        }
        
        /// <summary>
        /// This function is the same as above one.
        /// The difference is that it is used with the DataSet (Collection)
        /// </summary>
        /// <param name="selectedState"></param>
        /// <returns></returns>
        public DataSet getDistrictList(string selectedState)
        {
            //Returning the records in dataset (COLLECTION Type)
            DataSet districtData = tempState.getDistrictList(selectedState);
            return districtData;
        }
    }
}
